package net.zjitc.utils;

import com.mchange.v2.c3p0.ComboPooledDataSource;

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;

/**
 * Created by Administrator on 2017/9/18.
 */
public class C3P0Utils {
    //
    public static ComboPooledDataSource ds=null;
    //使用
    static {
        ds=new ComboPooledDataSource();
    }
    public static Connection getConnertion() throws SQLException{
        return ds.getConnection();
    }

    public static DataSource getDataSources(){
        return ds;
    }
}
